<?php

use Phalcon\Mvc\Model;

class TextTypes extends Model {

    protected $id;
    protected $name;

    public function initialize() {
        $this->hasMany("id", "Texts", "text_type");
    }

    public function getSource() {
		return "lb_text_type";
	}


    /**
     * Get the value of Id
     *
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set the value of Id
     *
     * @param mixed id
     *
     * @return self
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }

    /**
     * Get the value of Name
     *
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set the value of Name
     *
     * @param mixed name
     *
     * @return self
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    public function convertToArray() {
        return array(
            'id'        =>  (int)$this->id,
            'name'  =>  $this->name
        );
    }
}
